package com.qf.task;

import com.qf.pojo.User;
import com.qf.service.UserService;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * 任务类: 编写任务中需要执行的业务
 * @author 千锋健哥
 */
public class TestTask implements Job {

    @Autowired
    private UserService userService;

    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        System.out.println("============定时任务执行了===========");
        List<User> list = userService.findAll();
        System.out.println(list);
    }

}
